package com.cqw.controller;

import com.cqw.common.BaseResponse;
import com.cqw.domain.ActivityGroup;
import com.cqw.service.ActivityGroupService;
import com.cqw.vo.group.ActivityGroupVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: caoqingwen
 * @CreateTime: 2021-05-17 11:14
 * @Description: 团购api
 */
@RestController
@RequestMapping("/activity/group")
@Slf4j
@Api(tags = "团购")
public class ActivityGroupController {


    @Autowired
    private ActivityGroupService activityGroupService;


    @PostMapping("/create")
    @ApiOperation(value = "创建团购活动")
    public BaseResponse createGroupActivity(@RequestBody ActivityGroupVO activityGroupVO) {
        ActivityGroup activityGroup = activityGroupService.createActivityGroup(activityGroupVO);
        return BaseResponse.success(activityGroup);
    }


}
